diff --git a/README.md b/README.md index 17f938d..e071b74 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The result is produced in SVG to allow clean integration in picture-elements car Add the `rockrobo-path-card.js` file in your module folder (e.g. `/www/modules/`) then add the import in `ui-lovelace.yaml` configuration: ```yaml resources: - - url: /local/modules/rockrobo-path-card.js?v=1.0.0 + - url: /local/modules/rockrobo-path-card.js?v=1.0.1 type: module ``` @@ -60,7 +60,7 @@ It's highly recommended to exclude the sensor from recorder to keep database sma recorder: exclude: entities: - - sensor.xiaomi_map + - sensor.vacuum_map ``` ## Options diff --git a/rockrobo-path-card.js b/rockrobo-path-card.js index 7eea54c..5557653 100644 --- a/rockrobo-path-card.js +++ b/rockrobo-path-card.js @@ -101,8 +101,8 @@ class RockroboPathCard extends HTMLElement { const vacuumImage = document.createElementNS(ns, 'image'); vacuumImage.setAttributeNS('http://www.w3.org/1999/xlink', 'href', vacuumLink); - vacuumImage.setAttributeNS(null, 'x', Math.round(robotPosition[0] / 10.0)); - vacuumImage.setAttributeNS(null, 'y', Math.round(robotPosition[1] / 10.0)); + vacuumImage.setAttributeNS(null, 'x', Math.round(robotPosition[0] / 10.0) - this._config.vacuum_scale * 10); + vacuumImage.setAttributeNS(null, 'y', Math.round(robotPosition[1] / 10.0) - this._config.vacuum_scale * 10); vacuumImage.setAttributeNS(null, 'transform', `rotate(${robotAngle}deg)`); vacuumImage.setAttributeNS(null, 'width', `${this._config.vacuum_scale}vw`); vacuumImage.setAttributeNS(null, 'height', `${this._config.vacuum_scale}vw`);