v0.9.553
This commit is contained in:
@@ -20,7 +20,7 @@ from homeassistant.components.media_player import (
|
|||||||
RepeatMode,
|
RepeatMode,
|
||||||
)
|
)
|
||||||
|
|
||||||
VERSION = '0.9.410'
|
VERSION = '0.9.553'
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -137,16 +137,19 @@ class yoradioDevice(MediaPlayerEntity):
|
|||||||
await mqtt.async_subscribe(self.api.hass, self.api.root_topic+'/volume', self.volume_listener, 0, "utf-8")
|
await mqtt.async_subscribe(self.api.hass, self.api.root_topic+'/volume', self.volume_listener, 0, "utf-8")
|
||||||
|
|
||||||
async def status_listener(self, msg):
|
async def status_listener(self, msg):
|
||||||
js = json.loads(msg.payload)
|
|
||||||
self._media_title = js['title']
|
|
||||||
self._track_artist = js['name']
|
|
||||||
if js['on']==1:
|
|
||||||
self._state = MediaPlayerState.PLAYING if js['status']==1 else MediaPlayerState.IDLE
|
|
||||||
else:
|
|
||||||
self._state = MediaPlayerState.PLAYING if js['status']==1 else MediaPlayerState.OFF
|
|
||||||
self._current_source = str(js['station']) + '. ' + js['name']
|
|
||||||
try:
|
try:
|
||||||
self.async_schedule_update_ha_state()
|
js = json.loads(msg.payload)
|
||||||
|
self._media_title = js['title']
|
||||||
|
self._track_artist = js['name']
|
||||||
|
if js['on']==1:
|
||||||
|
self._state = MediaPlayerState.PLAYING if js['status']==1 else MediaPlayerState.IDLE
|
||||||
|
else:
|
||||||
|
self._state = MediaPlayerState.PLAYING if js['status']==1 else MediaPlayerState.OFF
|
||||||
|
self._current_source = str(js['station']) + '. ' + js['name']
|
||||||
|
try:
|
||||||
|
self.async_schedule_update_ha_state()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -234,6 +234,12 @@ Work is in progress...
|
|||||||
|
|
||||||
---
|
---
|
||||||
## Version history
|
## Version history
|
||||||
|
### 0.9.553
|
||||||
|
- fix "No 'Access-Control-Allow-Origin' header is present on the requested resource" on saving playlist\
|
||||||
|
just reupload the file `script.js.gz` with Webboard uploader
|
||||||
|
- fixed error "assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!)"
|
||||||
|
- fixed error "Exception in status_listener when handling msg" in HA component
|
||||||
|
|
||||||
### 0.9.552
|
### 0.9.552
|
||||||
- fixed compilation error for ESP cores version below 3.0.0\
|
- fixed compilation error for ESP cores version below 3.0.0\
|
||||||
Thanks to @salawalas ! https://github.com/e2002/yoradio/pull/197/
|
Thanks to @salawalas ! https://github.com/e2002/yoradio/pull/197/
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
#ifndef options_h
|
#ifndef options_h
|
||||||
#define options_h
|
#define options_h
|
||||||
|
|
||||||
#define YOVERSION "0.9.552"
|
#define YOVERSION "0.9.553"
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
DO NOT EDIT THIS FILE.
|
DO NOT EDIT THIS FILE.
|
||||||
|
|||||||
@@ -53,36 +53,11 @@ bool TimeKeeper::loop0(){ // core0 (display)
|
|||||||
_last2s = currentTime;
|
_last2s = currentTime;
|
||||||
_upRSSI();
|
_upRSSI();
|
||||||
}
|
}
|
||||||
if (currentTime - _last5s >= 5000) { // 2sec
|
if (currentTime - _last5s >= 5000) { // 5sec
|
||||||
_last5s = currentTime;
|
_last5s = currentTime;
|
||||||
//HEAP_INFO();
|
//HEAP_INFO();
|
||||||
}
|
}
|
||||||
#ifdef DUMMYDISPLAY
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
static uint32_t lastWeatherTime = 0;
|
|
||||||
if (currentTime - lastWeatherTime >= WEATHER_SYNC_INTERVAL) {
|
|
||||||
lastWeatherTime = currentTime;
|
|
||||||
forceWeather = true;
|
|
||||||
}
|
|
||||||
static uint32_t lastTimeTime = 0;
|
|
||||||
if (currentTime - lastTimeTime >= TIME_SYNC_INTERVAL) {
|
|
||||||
lastTimeTime = currentTime;
|
|
||||||
forceTimeSync = true;
|
|
||||||
}
|
|
||||||
if (!busy && (forceWeather || forceTimeSync) && network.status == CONNECTED) {
|
|
||||||
busy = true;
|
|
||||||
//config.setTimeConf();
|
|
||||||
xTaskCreatePinnedToCore(
|
|
||||||
_syncTask,
|
|
||||||
"syncTask",
|
|
||||||
SYNC_STACK_SIZE,
|
|
||||||
NULL, // Params
|
|
||||||
SYNC_TASK_PRIORITY,
|
|
||||||
NULL, // Descriptor
|
|
||||||
SYNC_TASK_CORE
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return true; // just in case
|
return true; // just in case
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +81,35 @@ bool TimeKeeper::loop1(){ // core1 (player)
|
|||||||
if (currentTime - _last2s >= 2000) { // 2sec
|
if (currentTime - _last2s >= 2000) { // 2sec
|
||||||
_last2s = currentTime;
|
_last2s = currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DUMMYDISPLAY
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
// Sync weather & time
|
||||||
|
static uint32_t lastWeatherTime = 0;
|
||||||
|
if (currentTime - lastWeatherTime >= WEATHER_SYNC_INTERVAL) {
|
||||||
|
lastWeatherTime = currentTime;
|
||||||
|
forceWeather = true;
|
||||||
|
}
|
||||||
|
static uint32_t lastTimeTime = 0;
|
||||||
|
if (currentTime - lastTimeTime >= TIME_SYNC_INTERVAL) {
|
||||||
|
lastTimeTime = currentTime;
|
||||||
|
forceTimeSync = true;
|
||||||
|
}
|
||||||
|
if (!busy && (forceWeather || forceTimeSync) && network.status == CONNECTED) {
|
||||||
|
busy = true;
|
||||||
|
//config.setTimeConf();
|
||||||
|
xTaskCreatePinnedToCore(
|
||||||
|
_syncTask,
|
||||||
|
"syncTask",
|
||||||
|
SYNC_STACK_SIZE,
|
||||||
|
NULL, // Params
|
||||||
|
SYNC_TASK_PRIORITY,
|
||||||
|
NULL, // Descriptor
|
||||||
|
SYNC_TASK_CORE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return true; // just in case
|
return true; // just in case
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +221,6 @@ void TimeKeeper::weatherTask(){
|
|||||||
|
|
||||||
bool _getWeather(char *wstr) {
|
bool _getWeather(char *wstr) {
|
||||||
#if (DSP_MODEL!=DSP_DUMMY || defined(USE_NEXTION)) && !defined(HIDE_WEATHER)
|
#if (DSP_MODEL!=DSP_DUMMY || defined(USE_NEXTION)) && !defined(HIDE_WEATHER)
|
||||||
|
|
||||||
WiFiClient client;
|
WiFiClient client;
|
||||||
const char* host = "api.openweathermap.org";
|
const char* host = "api.openweathermap.org";
|
||||||
if (!client.connect(host, 80)) {
|
if (!client.connect(host, 80)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user