Releases: smarthome-go/homescript
Releases · smarthome-go/homescript
Homescript v3.0.1
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
andoff
can now be used liketrue
andfalse
- 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 theto_json
and
to_json_indent
methods
Homescript v3.0.0
Changelog
This is the first release of the v3 version of Homescript
Homescript v2.5.0
Changelog
- Multiple imports are now supported
import {foo, bar} from baz;
- Fixed comma bugs in enum definition
Homescript v2.4.0
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
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
Changelog
- Added the
STORAGE
objectSTORAGE.get(string)
retrieves a saved valueSTORAGE.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
Changelog
- Added the
remind
builtin function which adds a new reminder to the user's
reminders - Fixed minor bugs
Homescript v2.0.8
Changelog
- Fixed the
debug
display ofobjects
which inserted a redundant blank line
Homescript v2.0.7
Changelog
- Fixed function import in the analyzer
- Improved import cycle error display
Homescript v2.0.6
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