tiles

Tile configuration: which source value each dashboard tile shows.

Stored as JSON on flash (TILES_FILE) and edited through the web interface; config.DEFAULT_TILES applies until then. A tile is

{“source”: “sensor.arbeitszimmer_temperatur”, “label”: “Arbeitszimmer”,

“decimals”: 1, “style”: “number”}

“source” is the ID within the data source (a Home Assistant entity ID, a SignalK path, …); “” leaves the tile empty. “style” is one of STYLES. Number tiles may add “trend”: the smallest change over about three hours that shows as an arrow (see trend); without it no trend is shown.

Attributes

Functions

validate(tiles)

Return a checked and normalised copy of tiles.

load(default[, path])

The saved tiles, or default if none are saved or they are invalid.

save(tiles[, path])

Validate and store tiles; returns the stored version.

sources(tiles)

Source IDs the tiles need, each once, in tile order.

to_layout(tiles)

Tiles in the form layout.render expects.

Module Contents

tiles.TILES_FILE = 'tiles.json'
tiles.COUNT = 6
tiles.MAX_LABEL = 20
tiles.MAX_SOURCE = 100
tiles.MAX_DECIMALS = 3
tiles.MAX_TREND = 10000
tiles.NUMBER = 'number'
tiles.TEXT = 'text'
tiles.WEATHER = 'weather'
tiles.STYLES
tiles.WEATHER_STATES
tiles.WEATHER_ICONS
tiles.TEXT_STATES
tiles.validate(tiles)

Return a checked and normalised copy of tiles.

Raises:

ValueError – If something is wrong, with a German message for the web interface.

tiles.load(default, path=TILES_FILE)

The saved tiles, or default if none are saved or they are invalid.

tiles.save(tiles, path=TILES_FILE)

Validate and store tiles; returns the stored version.

tiles.sources(tiles)

Source IDs the tiles need, each once, in tile order.

tiles.to_layout(tiles)

Tiles in the form layout.render expects.