Hi,
I’m finding a few bugs and wondering if anyone knows anything about them before I submit issues on gitub.
1. time.Duration
const timerDuration = items.getItem('BackHall_Ceiling_Light_MotionTimer').state // A Number Item
console.info(time.Duration.ofSeconds(1))
console.info(time.Duration.ofMinutes(1))
console.info(time.Duration.ofSeconds(timerDuration))
give me PT1S
, PT1M
, and PT1S
respectively.
But
console.info(time.Duration.ofMinutes(timerDuration))
throws an error:
ArithmeticException: Multiplication overflows: 1 * 60: ArithmeticException: Multiplication overflows: 1 * 60
and ofHours
says something similar:
ArithmeticException: Multiplication overflows: 1 * 3600: ArithmeticException: Multiplication overflows: 1 * 3600
only ‘ofSeconds’ seems to work.
2. things.getThings() .setLabel
When I change a thing’s label with JS Scripting, it works, but doesn’t stick after a reboot.
things.getThing('test:thing:45636344247:62464367').setLabel('A New Label')
3. items.replaceItem
With JS Scripting, if I set the giBaseType to ‘String’, it doesn’t apply this to the new item. Other base types and aggregation functions work fine.
items.replaceItem({
type: 'Group',
name: 'Item_Name',
label: 'Item Label',
groups: ['group1', 'group2'],
tags: ['Setpoint'],
category: 'lightbulb',
giBaseType: 'Switch'
// groupFunction: aggregationFunction
});
4. Applying metadata
When I apply metadata (any kind) using JS scripting, it works, but the UI displays ‘Not Set’
let itemToEdit = items.getItem('Test_Item);
itemToEdit.replaceMetadata('stateDescription', '', { options: 'ON=MOTION,OFF=NO MOTION'} );
5. material icons
I can apply a material icon and it works in most places.
but it shows as blank in a default list widget
Am I doing something wrong? Seems unusual to find 5 bugs in a row