tiles ===== .. py:module:: tiles .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: tiles.TILES_FILE tiles.COUNT tiles.MAX_LABEL tiles.MAX_SOURCE tiles.MAX_DECIMALS tiles.MAX_TREND tiles.NUMBER tiles.TEXT tiles.WEATHER tiles.STYLES tiles.WEATHER_STATES tiles.WEATHER_ICONS tiles.TEXT_STATES Functions --------- .. autoapisummary:: tiles.validate tiles.load tiles.save tiles.sources tiles.to_layout Module Contents --------------- .. py:data:: TILES_FILE :value: 'tiles.json' .. py:data:: COUNT :value: 6 .. py:data:: MAX_LABEL :value: 20 .. py:data:: MAX_SOURCE :value: 100 .. py:data:: MAX_DECIMALS :value: 3 .. py:data:: MAX_TREND :value: 10000 .. py:data:: NUMBER :value: 'number' .. py:data:: TEXT :value: 'text' .. py:data:: WEATHER :value: 'weather' .. py:data:: STYLES .. py:data:: WEATHER_STATES .. py:data:: WEATHER_ICONS .. py:data:: TEXT_STATES .. py:function:: validate(tiles) Return a checked and normalised copy of `tiles`. :raises ValueError: If something is wrong, with a German message for the web interface. .. py:function:: load(default, path=TILES_FILE) The saved tiles, or `default` if none are saved or they are invalid. .. py:function:: save(tiles, path=TILES_FILE) Validate and store `tiles`; returns the stored version. .. py:function:: sources(tiles) Source IDs the tiles need, each once, in tile order. .. py:function:: to_layout(tiles) Tiles in the form layout.render expects.