Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.minecraft_server.api.MinecraftServer Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, MinecraftServerType server_type, str address)
 
MinecraftServerData async_get_data (self)
 
None async_initialize (self)
 
bool async_is_online (self)
 

Private Member Functions

MinecraftServerData _extract_bedrock_data (self, BedrockStatusResponse status_response)
 
MinecraftServerData _extract_java_data (self, JavaStatusResponse status_response)
 
str _get_error_message (self, BaseException error)
 

Private Attributes

 _address
 
 _hass
 
 _server
 
 _server_type
 

Detailed Description

Minecraft Server wrapper class for 3rd party library mcstatus.

Definition at line 60 of file api.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.minecraft_server.api.MinecraftServer.__init__ (   self,
HomeAssistant  hass,
MinecraftServerType  server_type,
str   address 
)
Initialize server instance.

Definition at line 65 of file api.py.

Member Function Documentation

◆ _extract_bedrock_data()

MinecraftServerData homeassistant.components.minecraft_server.api.MinecraftServer._extract_bedrock_data (   self,
BedrockStatusResponse   status_response 
)
private
Extract Bedrock Edition server data out of status response.

Definition at line 156 of file api.py.

◆ _extract_java_data()

MinecraftServerData homeassistant.components.minecraft_server.api.MinecraftServer._extract_java_data (   self,
JavaStatusResponse   status_response 
)
private
Extract Java Edition server data out of status response.

Definition at line 136 of file api.py.

◆ _get_error_message()

str homeassistant.components.minecraft_server.api.MinecraftServer._get_error_message (   self,
BaseException  error 
)
private
Get error message of an exception.

Definition at line 172 of file api.py.

◆ async_get_data()

MinecraftServerData homeassistant.components.minecraft_server.api.MinecraftServer.async_get_data (   self)
Get updated data from the server, supporting both Java and Bedrock Edition servers.

Definition at line 113 of file api.py.

◆ async_initialize()

None homeassistant.components.minecraft_server.api.MinecraftServer.async_initialize (   self)
Perform async initialization of server instance.

Definition at line 74 of file api.py.

◆ async_is_online()

bool homeassistant.components.minecraft_server.api.MinecraftServer.async_is_online (   self)
Check if the server is online, supporting both Java and Bedrock Edition servers.

Definition at line 96 of file api.py.

Member Data Documentation

◆ _address

homeassistant.components.minecraft_server.api.MinecraftServer._address
private

Definition at line 72 of file api.py.

◆ _hass

homeassistant.components.minecraft_server.api.MinecraftServer._hass
private

Definition at line 70 of file api.py.

◆ _server

homeassistant.components.minecraft_server.api.MinecraftServer._server
private

Definition at line 69 of file api.py.

◆ _server_type

homeassistant.components.minecraft_server.api.MinecraftServer._server_type
private

Definition at line 71 of file api.py.


The documentation for this class was generated from the following file: