Miscellaneous Fixes

This commit is contained in:
Otto Winter
2019-02-03 20:46:18 +01:00
parent 98bdfc821e
commit 4a74027848
20 changed files with 63 additions and 66 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ from esphomeyaml.components import display, font
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_FILE, CONF_ID, CONF_RESIZE
from esphomeyaml.core import CORE, HexInt
from esphomeyaml.cpp_generator import ArrayInitializer, MockObj, Pvariable, RawExpression, add
from esphomeyaml.cpp_generator import MockObj, Pvariable, RawExpression, add, safe_exp
from esphomeyaml.cpp_types import App
_LOGGER = logging.getLogger(__name__)
@@ -59,7 +59,7 @@ def to_code(config):
raw_data = MockObj(config[CONF_RAW_DATA_ID])
add(RawExpression('static const uint8_t {}[{}] PROGMEM = {}'.format(
raw_data, len(data),
ArrayInitializer(*[HexInt(x) for x in data], multiline=False))))
safe_exp([HexInt(x) for x in data]))))
rhs = App.make_image(raw_data, width, height)
Pvariable(config[CONF_ID], rhs)