Documentation
¶
Index ¶
- Constants
- func BaseForecast() m.Attributes
- func GetActorState(state string, n, w bool) (actorState entity_manager.ActorState)
- func GetImagePath(state string, night, winter bool) (imagePath *string)
- func GetIndexByState(state string) (idx int)
- func GetStateByIndex(idx int) (state string)
- func New() plugins.Plugable
- func NewActorStates(n, w bool) (states map[string]entity_manager.ActorState)
- func NewAttr() m.Attributes
- func NewForecast(days int) m.Attributes
- func NewSettings() m.Attributes
- type Actor
- type EventStateChanged
Constants ¶
View Source
const ( Name = "weather" // EntityWeather ... EntityWeather = common.EntityType("weather") )
View Source
const ( AttrForecast = "forecast" AttrForecastDay1 = "forecast_day1" AttrForecastDay2 = "forecast_day2" AttrForecastDay3 = "forecast_day3" AttrForecastDay4 = "forecast_day4" AttrForecastDay5 = "forecast_day5" AttrWeatherCondition = "condition" AttrWeatherDatetime = "datetime" AttrWeatherAttribution = "attribution" AttrWeatherHumidity = "humidity" AttrWeatherOzone = "ozone" AttrWeatherPressure = "pressure" AttrWeatherTemperature = "temperature" AttrWeatherMinTemperature = "min_temperature" AttrWeatherMaxTemperature = "max_temperature" AttrWeatherVisibility = "visibility" AttrWeatherWindBearing = "wind_bearing" AttrWeatherWindSpeed = "wind_speed" AttrWeatherMain = "main" AttrWeatherDescription = "description" AttrWeatherIcon = "icon" Attribution = "" AttrLat = "lat" AttrLon = "lon" AttrPlugin = "plugin" )
View Source
const ( StateClearSky = "clearSky" StateFair = "fair" StatePartlyCloudy = "partlyCloudy" StateCloudy = "cloudy" StateLightRainShowers = "lightRainShowers" StateRainShowers = "rainShowers" StateHeavyRainShowers = "heavyRainShowers" StateLightRainShowersAndThunder = "lightRainShowersAndThunder" StateRainShowersAndThunder = "rainShowersAndThunder" StateHeavyRainShowersAndThunder = "heavyRainShowersAndThunder" StateLightSleetShowers = "lightSleetShowers" StateSleetShowers = "sleetShowers" StateHeavySleetShowers = "heavySleetShowers" StateLightSleetShowersAndThunder = "lightSleetShowersAndThunder" StateSleetShowersAndThunder = "sleetShowersAndThunder" StateHeavySleetShowersAndThunder = "heavySleetShowersAndThunder" StateLightSnowShowers = "lightSnowShowers" StateSnowShowers = "snowShowers" StateHeavySnowShowers = "heavySnowShowers" StateLightSnowShowersAndThunder = "lightSnowShowersAndThunder" StateSnowShowersAndThunder = "snowShowersAndThunder" StateHeavySnowShowersAndThunder = "heavySnowShowersAndThunder" StateLightRain = "lightRain" StateRain = "rain" StateHeavyRain = "heavyRain" StateLightRainAndThunder = "lightRainAndThunder" StateRainAndThunder = "rainAndThunder" StateHeavyRainAndThunder = "heavyRainAndThunder" StateLightSleet = "lightSleet" StateSleet = "sleet" StateHeavySleet = "heavySleet" StateLightSleetAndThunder = "lightSleetAndThunder" StateSleetAndThunder = "sleetAndThunder" StateHeavySleetAndThunder = "heavySleetAndThunder" StateLightSnow = "lightSnow" StateSnow = "snow" StateHeavySnow = "heavySnow" StateLightSnowAndThunder = "lightSnowAndThunder" StateSnowAndThunder = "snowAndThunder" StateHeavySnowAndThunder = "heavySnowAndThunder" StateFog = "fog" )
View Source
const (
StatePositionUpdate = "positionUpdate"
)
View Source
const (
TopicPluginWeather = string("plugin.weather")
)
Variables ¶
This section is empty.
Functions ¶
func BaseForecast ¶
func BaseForecast() m.Attributes
func GetActorState ¶
func GetActorState(state string, n, w bool) (actorState entity_manager.ActorState)
func GetImagePath ¶
func GetIndexByState ¶
func GetStateByIndex ¶
func NewActorStates ¶
func NewActorStates(n, w bool) (states map[string]entity_manager.ActorState)
func NewAttr ¶
func NewAttr() m.Attributes
func NewForecast ¶
func NewForecast(days int) m.Attributes
func NewSettings ¶
func NewSettings() m.Attributes
Types ¶
type Actor ¶
type Actor struct {
entity_manager.BaseActor
// contains filtered or unexported fields
}
func NewActor ¶
func NewActor(entity *m.Entity, entityManager entity_manager.EntityManager, eventBus event_bus.EventBus) *Actor
func (*Actor) SetState ¶
func (e *Actor) SetState(params entity_manager.EntityStateParams) error
func (*Actor) Spawn ¶
func (e *Actor) Spawn() entity_manager.PluginActor
func (*Actor) UpdatePosition ¶
func (e *Actor) UpdatePosition(settings m.Attributes)
type EventStateChanged ¶
type EventStateChanged struct {
Type common.EntityType `json:"type"`
EntityId common.EntityId `json:"entity_id"`
State string `json:"state"`
Attributes m.Attributes `json:"attributes"`
Settings m.Attributes `json:"settings"`
}
Click to show internal directories.
Click to hide internal directories.