Skip to content

Releases: smarthome-go/homescript

Homescript v3.0.1

10 Aug 17:58
Compare
Choose a tag to compare

Changelog

Features

  • Added the to_string method to values of type { ? }
  • Added the match expression
  • Integer literals can now be converted to floats when the f character follows
    the integer immediately: 42f
  • The keywords on and off can now be used like true and false
  • When arguments of a function call are missing, their names are now shown in
    the error message
  • Added the unwrap_or method to values of type ?any

Bug fixes

  • Fixed various bugs related to type-checking and casting
  • Fixed various bugs related to the display of error messages
  • Values of type { ? } can now be marshaled to JSON using the to_json and
    to_json_indent methods

Homescript v3.0.0

27 Jun 20:34
Compare
Choose a tag to compare
Homescript v3.0.0 Pre-release
Pre-release

Changelog

This is the first release of the v3 version of Homescript

Homescript v2.5.0

19 Apr 10:01
Compare
Choose a tag to compare

Changelog

  • Multiple imports are now supported
import {foo, bar} from baz;
  • Fixed comma bugs in enum definition

Homescript v2.4.0

12 Apr 17:40
Compare
Choose a tag to compare

Changelog

  • Added enumerations
enum Day {
    Monday,
    Tuesday,
    # ...
    Sunday,
}

assert(Day::Monday != Day::Tuesday)
  • 'Lambda' functions are now also analyzed upon definition

  • Errors now contain filenames

  • The HTTP functions now also support cookies

fn __connect() {
  let login_req = {
    username: "foo",
    password: "bar",
  };

  let res = http(
    fmt('%s/api/login', base_url),
    'POST',
    login_req.to_json(),
    ["Content-Type" => "application/json"],
    [
      # Cookies would go here
    ],
  );

  println(res.cookies);

  # Cookies can then be reused
  http(
    # ...,
    res.cookies,
  )
}

Homescript v2.3.0

15 Mar 18:24
Compare
Choose a tag to compare

Changelog

  • Added iterators
for element in ['a', 'b', 'c'] {
  println(element)
}

for kv in {key1: "value1", key2: "value2"} {
  println("Key:", kv.k, "Value:", kv.v)
}

for i in 0..10 {
  println(i)
}

for i in 10.range() {
  println(i)
}

for char in "Hello World!" {
  print(char)
}
  • Added date addition
time.add_minutes(time.now(), 1);
time.add_hours(time.now(), 1);
time.add_days(time.now(), 1);
  • Expressions at the end of a block are now allowed
let res = if true {
  1 + 2 + 3
};
  • Fixed string to boolean casts

Homescript v2.2.0

22 Jan 14:07
Compare
Choose a tag to compare

Changelog

  • Added the STORAGE object
    • STORAGE.get(string) retrieves a saved value
    • STORAGE.set(string, any) saves a new value (automatically converts the second argument to string)
  • Added to fmt function which works identical to the GO implementation
  • Comparison between a value and null is now allowed and works like expected
  • Fixed minor bugs in the analyzer & interpreter

Homescript v2.1.0

27 Dec 20:18
Compare
Choose a tag to compare

Changelog

  • Added the remind builtin function which adds a new reminder to the user's
    reminders
  • Fixed minor bugs

Homescript v2.0.8

18 Dec 18:37
Compare
Choose a tag to compare

Changelog

  • Fixed the debug display of objects which inserted a redundant blank line

Homescript v2.0.7

03 Nov 20:34
Compare
Choose a tag to compare

Changelog

  • Fixed function import in the analyzer
  • Improved import cycle error display

Homescript v2.0.6

31 Oct 10:42
Compare
Choose a tag to compare

Changelog

  • Added ImportError kind
  • Improved function imports from modules in analyzer
  • Fixed various stability issues and bugs
  • Added the string.len builtin function
  • Added the object.keys builin function
  • Added the ping builin function
  • Enhanced debug output to include type information